﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Text;
using OgilvyOne.BLL;
using OgilvyOne.Model;
using System.IO;

public partial class admin_allergy_doctor_img_list : System.Web.UI.Page
{
    public int isaudit = 0;
    protected void Page_Load(object sender, EventArgs e)
    {
        //if (!IsPostBack)
        {
            //this.headers.Text = new ColumnBll().LayeridColumnConNaiv(Request.Params["layerid"]);
            Grid_viewBild();
        }
    }

    private void Grid_viewBild()
    {
        DataTable dt = BLLArticleInfo.getImg(Request.Params["id"]);
        GridView1.DataSource = dt;
        GridView1.AllowPaging = false;
        GridView1.DataBind();
        //this.pagehtml.Text = getPageHtml(GridView1.PageCount, GridView1.PageIndex + 1, datalist.Count);
    }

    protected void Add_click(object sender, EventArgs e)
    {
        //Response.Redirect("dotcor_img_detail.aspx?id=" + Request.Params["id"] + "&layerid=" + Request.Params["layerid"], true);
        Response.Redirect("dotcor_img_detail.aspx?id=" + Request.Params["id"]);
    }



    protected void Delone_click(object sender, EventArgs e)
    {
        string imgid = ((LinkButton)sender).CommandArgument;
        string path = ((LinkButton)sender).CommandName;
        BLLArticleInfo.delImg(imgid);
        File.Delete(Server.MapPath("../../allergy/uploadfiles/image/") + path);
        Grid_viewBild();
    }



    protected void Mod_click(object sender, EventArgs e)
    {
        Response.Redirect("dotcor_img_detail.aspx?imgId=" + ((LinkButton)sender).CommandArgument + "&id=" + Request.Params["id"], true);
    }
}
